package cn.com.clearbus.event;

import cn.com.clearbus.event.UpLoadFileEvent;
import cn.com.clearbus.mini.entity.MiniUser;
import cn.com.clearbus.mini.service.IMiniUserService;
import cn.com.clearbus.mini.utils.MaiUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class MiniApplicationListener implements ApplicationListener<UpLoadFileEvent> {

    @Autowired
    IMiniUserService miniUserService;

    @Autowired
    MaiUtils maiUtils;

    /**
     * TODO:了解一次性邮件最多发多少人，一行性进行最大量的群发。最大20个
     *      分批次发
     * @param upLoadFileEvent
     */
    @Override
    public void onApplicationEvent(UpLoadFileEvent upLoadFileEvent) {
        List<MiniUser> allMiniUser = miniUserService.getAllMiniUser();
        //maiUtils.sendHTMLMail();
    }
}
